<#include "include/_meta.html">
<html>
<head>
    <title>管理员列表</title>

</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 车辆管理<span class="c-gray en">&gt;</span> 车辆保养记录列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div id="app" class="app">
        <form id="addf" onsubmit="return false">
            <table class="table">
                <tr>
                    <td>记录编号</td><td><input type="text" id="recordid" name="recordid"></td>
                </tr>
                <tr>
                    <td>车辆编号</td><td><input type="text" id="carid" name="carid"></td>
                </tr>
                <tr>
                    <td>发车里程</td><td><input type="text" id="initmile" name="initmile"></td>
                </tr>
                <tr>
                    <td>发车油量</td><td><input type="text" id="initoil" name="initoil"></td>
                </tr>
                <tr>
                    <td>保养地点</td><td><input type="text" id="address" name="address"></td>
                </tr>

                <tr>
                    <td>出车时间</td><td><input type="date" id="usecartime" name="usecartime"></td>
                </tr>
                <tr>
                    <td>经办人员</td><td><input type="text" id="headman" name="headman"></td>
                </tr>
                <tr>
                    <td>经办手机</td><td><input type="text" id="headmobile" name="headmobile"></td>
                </tr>
                <tr>
                    <td>还车时间</td><td><input type="date" id="returntime" name="returntime"></td>
                </tr>
                <tr>
                    <td>还车里程</td><td><input type="text" id="returnmile" name="returnmile"></td>
                </tr>

                <tr>
                    <td>还车油量</td><td><input type="text" id="returnoil" name="returnoil"></td>
                </tr>
                <tr>
                    <td>保养费用</td><td><input type="text" id="costmoney" name="costmoney"></td>
                </tr>
                <tr>
                    <td>保养内容</td><td><input type="text" id="costcontent" name="costcontent"></td>
                </tr>
                <tr>
                    <td>备注信息</td><td><input type="text" id="remark" name="remark"></td>
                </tr>
                <tr>
                    <td>下次保养时间</td><td><input type="date" id="nexttime" name="nexttime"></td>
                </tr>

                <tr>
                    <td>下次保养里程</td><td><input type="text" id="nextmile" name="nextmile"></td>
                </tr>
                <tr>
                    <td>默认为系统时间</td><td><input type="date" id="addtime" name="addtime"></td>
                </tr>
            </table>
            <input type="submit" id="buss" value="提交"><input id="cancelBtn" type="button" value="取消">
        </form>
    </div>
</div>
<#include "include/_footer.html">
<script>
    $("#cancelBtn").click(function () {
        var index=parent.layer.getFrameIndex(window.name);
        parent.getCarInsuPagelist();
        parent.layer.close(index);
    });
    $('#addf').validate({
        keyup: false,
        onblur: true,
        rules: {
            recordid:{
                required: true
            },
            carid:{
                required: true
            },
            initmile:{
                required: true,
                number: true
            },
            initoil:{
                required: true,
                number: true
            },
            address:{
                required: true
            },
            usecartime:{
                required: true
            },
            headman:{
                required: true
            },
            headmobile:{
                required: true
            },
            returntime:{
                required: true
            },
            returnmile:{
                required: true,
                number: true
            },
            returnoil:{
                required: true,
                number: true
            },
            costmoney:{
                required: true,
                number: true
            },
            costcontent:{
                required: true
            },
            remark:{
                required: true
            },
            nexttime:{
                required: true
            },
            nextmile:{
                required: true,
                number: true
            },
            addtime:{
                required: true
            }
        },
        submitHandler: function () {
            $.ajax({
                url:'/maints/adds',
                type:'POST',
                dataType:'json',
                data:$('#addf').serialize(),
                success:function (data) {
                    if (data!=0){
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.getCarInsuPagelist();
                        parent.layer.close(index);
                    }
                    else {
                        layer.alert('添加失败');
                    }
                }
            })
        }
    });

</script>
</body>
</html>